pom.xml坐标： 
        <!--读取word文档内表格内容-->
        <dependency>
            <groupId>org.docx4j</groupId>
            <artifactId>docx4j</artifactId>
            <version>6.1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jcl-over-slf4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency> 
        <!--读取word文档内表格内容-->

代码：
package com.example.demo.excel_utu;

import org.apache.commons.lang3.StringUtils;
import org.docx4j.jaxb.XPathBinderAssociationIsPartialException;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart;
import org.docx4j.wml.Tbl;
import org.docx4j.wml.Tc;
import org.docx4j.wml.Tr;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import java.io.File;
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;

public class XMLReadWordUtil {
    // 存储所有表数据的集合
    private List<List<List<String>>> benchmarkDataAll = new LinkedList<>();

    // 存储所有表数据的集合
    private Map<String, List<List<String>>> benchmarkData = new HashMap<>();

    /**
     * 按照文件流方式 读取 word文档中全部表内容
     *
     * @param fileIs
     * @throws Exception
     */
    public void process(InputStream fileIs) throws Exception{
        MainDocumentPart doc = WordprocessingMLPackage.load(fileIs).getMainDocumentPart();
        List<List<List<String>>> datas = readWordInTable(doc);
        this.benchmarkDataAll = datas;
    }

    /**
     * 按照文件方式 读取 word文档中全部表内容
     * @param fileName
     * @throws Exception
     */
    public void process(String fileName) throws Exception{
        File file = new File(fileName);
        MainDocumentPart doc = WordprocessingMLPackage.load(file).getMainDocumentPart();
        List<List<List<String>>> datas = readWordInTable(doc);
        this.benchmarkDataAll = datas;
    }

    /**
     * 按照文件流方式 读取 word文档中按表头信息模糊查询，抓取表头对应表内容
     * @param fileIs
     * @param titleName
     * @throws Exception
     */
    public void process(InputStream fileIs, String titleName) throws Exception{
        MainDocumentPart doc = WordprocessingMLPackage.load(fileIs).getMainDocumentPart();
        Map<String, List<List<String>>> data = readWordInTable(doc, titleName);
        this.benchmarkData = data;
    }

    /**
     * 按照文件方式 读取 word文档中按表头信息模糊查询，抓取表头对应表内容
     * @param fileName
     * @param titleName
     * @throws Exception
     */
    public void process(String fileName, String titleName) throws Exception{
        File file = new File(fileName);
        MainDocumentPart doc = WordprocessingMLPackage.load(file).getMainDocumentPart();
        Map<String, List<List<String>>> data = readWordInTable(doc, titleName);
        this.benchmarkData = data;
    }

    /**
     * 照文件流方式 读取 word文档中按照表顺序对应下标抓取对应表内容(下标从1开始)
     * @param fileIs
     * @param index
     * @throws Exception
     */
    public void process(InputStream fileIs, Integer index) throws Exception {
        MainDocumentPart doc = WordprocessingMLPackage.load(fileIs).getMainDocumentPart();
        Map<String, List<List<String>>> data = readWordInTable(doc, index);
        this.benchmarkData = data;
    }

    /**
     * 照文件方式 读取 word文档中按照表顺序对应下标抓取对应表内容(下标从1开始)
     * @param fileNale
     * @param index
     * @throws Exception
     */
    public void process(String fileNale, Integer index) throws Exception {
        File file = new File(fileNale);
        MainDocumentPart doc = WordprocessingMLPackage.load(file).getMainDocumentPart();
        Map<String, List<List<String>>> data = readWordInTable(doc, index);
        this.benchmarkData = data;
    }

    /**
     * 抓取所有表内容
     * @param doc
     * @return
     * @throws Exception
     */
    private  List<List<List<String>>> readWordInTable(MainDocumentPart doc) throws Exception{
        List<Object> parts = doc.getJAXBNodesViaXPath("//w:tbl", false);

        // 存储所有表数据集合
        List<List<List<String>>> benchmarkDataAll = new LinkedList<>();

        //循环获取每张表数据
        for (Object part : parts) {
            AtomicInteger rowIndex = new AtomicInteger(0);
            AtomicInteger colIndex = new AtomicInteger(0);

            //创建存储表数据集合
            List<List<String>> benchmarkData = new LinkedList<>();
            ((Tbl)((JAXBElement)part).getValue()).getContent().stream().filter(item -> (item instanceof Tr)).forEach(tr ->  {
                //创建存储行数据d的集合
                List<String> rowData = new ArrayList<>();
                colIndex.set(0);
                rowIndex.getAndAdd(1);
                ((Tr) tr).getContent().forEach(td -> {
                    colIndex.getAndAdd(1);
                    String filedValue = StringUtils.trim(((Tc)((JAXBElement)td).getValue()).getContent().toString().replace("\\[","").replaceFirst("\\]",""));
                    rowData.add(filedValue);
                });
                benchmarkData.add(rowData);
            });
            benchmarkDataAll.add(benchmarkData);
        }
        return benchmarkDataAll;
    }


    /**
     * 按表头信息模糊查询，抓取表头对应表内容
     *
     * @param doc
     * @param titleName
     * @return
     * @throws Exception
     */
    private  Map<String, List<List<String>>> readWordInTable(MainDocumentPart doc, String titleName) throws Exception{
        List<Object> parts = doc.getJAXBNodesViaXPath("//w:p[contains(string(), '"+titleName+"') and starts-with(string(), '表')]/following-sibling::w:tbl[1]", false);
        List<Object> partNames = doc.getJAXBNodesViaXPath("//w:p[contains(string(), '"+titleName+"') and starts-with(string(), '表')]", false);

        if (parts == null || parts.size() == 0)
            return null;

        // 存储所有表数据集合
        Map<String, List<List<String>>> benchmarkDataAll = new HashMap<>();

        //循环获取每张表数据
        for (int i = 0; i < parts.size(); i++) {
            AtomicInteger rowIndex = new AtomicInteger(0);
            AtomicInteger colIndex = new AtomicInteger(0);

            //创建存储表数据集合
            List<List<String>> benchmarkData = new LinkedList<>();
            ((Tbl)((JAXBElement) parts.get(i)).getValue()).getContent().stream().filter(item -> (item instanceof Tr)).forEach(tr ->  {
                //创建存储行数据d的集合
                List<String> rowData = new ArrayList<>();
                colIndex.set(0);
                rowIndex.getAndAdd(1);
                ((Tr) tr).getContent().forEach(td -> {
                    colIndex.getAndAdd(1);
                    String filedValue = StringUtils.trim(((Tc)((JAXBElement)td).getValue()).getContent().toString().replace("\\[","").replaceFirst("\\]",""));
                    rowData.add(filedValue);
                });
                benchmarkData.add(rowData);
            });
            benchmarkDataAll.put(partNames.get(i).toString(),benchmarkData);
        }
        return benchmarkDataAll;
    }

    /**
     * 按照表顺序对应下标抓取对应表内容(下标从1开始)
     *
     * @param doc
     * @param index
     * @return
     * @throws Exception
     */
    private  Map<String, List<List<String>>> readWordInTable(MainDocumentPart doc, Integer index) throws Exception{
        List<Object> parts = doc.getJAXBNodesViaXPath("//w:tbl["+index+"]", false);

        if (parts == null || parts.size() == 0)
            return null;

        // 存储所有表数据集合
        Map<String, List<List<String>>> benchmarkDataAll = new HashMap<>();

        //循环获取每张表数据
        for (int i = 0; i < parts.size(); i++) {
            AtomicInteger rowIndex = new AtomicInteger(0);
            AtomicInteger colIndex = new AtomicInteger(0);

            //创建存储表数据集合
            List<List<String>> benchmarkData = new LinkedList<>();
            ((Tbl)((JAXBElement) parts.get(i)).getValue()).getContent().stream().filter(item -> (item instanceof Tr)).forEach(tr ->  {
                //创建存储行数据d的集合
                List<String> rowData = new ArrayList<>();
                colIndex.set(0);
                rowIndex.getAndAdd(1);
                ((Tr) tr).getContent().forEach(td -> {
                    colIndex.getAndAdd(1);
                    String filedValue = StringUtils.trim(((Tc)((JAXBElement)td).getValue()).getContent().toString().replace("\\[","").replaceFirst("\\]",""));
                    rowData.add(filedValue);
                });
                benchmarkData.add(rowData);
            });
            benchmarkDataAll.put(index+"",benchmarkData);
        }
        return benchmarkDataAll;
    }



    public List<List<List<String>>> getBenchmarkDataAll() {
        return benchmarkDataAll;
    }

    public void setBenchmarkDataAll(List<List<List<String>>> benchmarkDataAll) {
        this.benchmarkDataAll = benchmarkDataAll;
    }

    public Map<String, List<List<String>>> getBenchmarkData() {
        return benchmarkData;
    }

    public void setBenchmarkData(Map<String, List<List<String>>> benchmarkData) {
        this.benchmarkData = benchmarkData;
    }

    public static void main(String[] args) throws Exception {
        XMLReadWordUtil xmlReadWordUtil = new XMLReadWordUtil();
        xmlReadWordUtil.process("C:\\Users\\asdc\\Desktop\\项目文档\\评级报告校验评级数据\\RMBS报告模板.docx","分布情况");
        System.out.println(xmlReadWordUtil.getBenchmarkData());
    }
}